import request from '@/utils/request'

export function getDepartment(did) {
  return request({
    url: '/department/get',
    params: {
      'did': did
    },
    method: 'get'
  })
}

export function searchDepartment(keyword) {
  return request({
    url: '/department/searchbyname',
    params: {
      'name': keyword
    },
    method: 'get'
  })
}

export function listDepartment(pos, size, conditions) {
  return request({
    url: '/department/list',
    params: {
      'jsonCondition': JSON.stringify(conditions),
      'pos': pos,
      'size': size
    },
    method: 'get'
  })
}
export function delDepartment(departmentmodel) {
  return request({
    url: '/department/del',
    data: departmentmodel,
    method: 'post'
  })
}
export function delDepartments(jsonDepartmentModel) {
  return request({
    url: '/department/bulkdel',
    data: {
      data: jsonDepartmentModel
    },
    method: 'post'
  })
}
export function setDepartment(departmentmodel) {
  return request({
    url: '/department/set',
    data: departmentmodel,
    method: 'post'
  })
}
